import { Tabbar, TabbarItem, NavBar, Swipe, SwipeItem, Cell, CellGroup, RadioGroup, Radio, Image as VanImage, Lazyload, Loading, Toast, Icon, PullRefresh, List, Empty, Popup, ShareSheet, Slider, Dialog, IndexBar, IndexAnchor, Search, Tab, Tabs } from 'vant' // 引入所需的组件

// 创建数组保存需要使用到的组件库
const VAntList = [Tabbar, TabbarItem, NavBar, Swipe, SwipeItem, Cell, CellGroup, RadioGroup, Radio, VanImage, Lazyload, Loading, Toast, Icon, PullRefresh, List, Empty, Popup, ShareSheet, Slider, Dialog, IndexBar, IndexAnchor, Search, Tab, Tabs] // 将引入的组件放入改数组中

// 使用install为项目安装插件
const VAntPlugins = {
  // install 是一个方法，当外界use 这个组件的时候：就会调用本身的install 方法； 同时传vue 这个类方法；
  install: (Vue) => {
    VAntList.forEach((comp) => {
      Vue.use(comp)
    })
  }
}

// 将VAntPlugins公开
export default VAntPlugins
